package com.significantfiles.snapshot.engine.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.jboss.marshalling.ByteInput;

public class FileByteInput implements ByteInput {

	private final FileInputStream fin;

	public FileByteInput(final File file) throws FileNotFoundException {
		if (file == null)
			throw new NullPointerException();

		this.fin = new FileInputStream( file );
	}

	@Override
	public int available() throws IOException {
		return this.fin.available();
	}

	@Override
	public int read() throws IOException {
		return this.fin.read();
	}

	@Override
	public int read(byte[] arg0) throws IOException {
		return this.fin.read(arg0);
	}

	@Override
	public int read(byte[] arg0, int arg1, int arg2) throws IOException {
		return this.fin.read(arg0, arg1, arg2);
	}

	@Override
	public long skip(long arg0) throws IOException {
		return this.fin.skip( arg0 );
	}

	@Override
	public void close() throws IOException {
		this.fin.close();
	}

}
